package pers.mobian.springseventh;

import org.springframework.beans.factory.support.AbstractBeanDefinition;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @Date 2021/7/18 16:52
 * @Created mobian
 * @Description
 */
public class MainTest1 {
	public static void main(String[] args) {

		AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();

		AbstractBeanDefinition beanDefinition = BeanDefinitionBuilder.genericBeanDefinition().getBeanDefinition();
		beanDefinition.setBeanClass(MoBian.class);

		context.registerBeanDefinition("mobian",beanDefinition);

		context.refresh();
		System.out.println(context.getBean("mobian"));
	}
}
